﻿<Application x:Class="Nox.Amuse.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:s="clr-namespace:System;assembly=mscorlib"
             Startup="Application_Startup"
             Exit="Application_Exit">
    <Application.Resources>
        <Color x:Key="AmuseGreen"
               A="255"
               R="2"
               G="159"
               B="81" />
        <SolidColorBrush x:Key="AmuseGreenBrush"
                         Color="{StaticResource AmuseGreen}" />
        <Color x:Key="AmuseBlue"
               A="255"
               R="2"
               G="162"
               B="152" />
        <SolidColorBrush x:Key="AmuseBlueBrush"
                         Color="{StaticResource AmuseBlue}" />
        <Color x:Key="AmusePurple"
               A="255"
               R="50"
               G="0"
               B="74" />
        <SolidColorBrush x:Key="AmusePurpleBrush"
                         Color="{StaticResource AmusePurple}" />
        <Color x:Key="CharactersBlue"
               A="255"
               R="98"
               G="193"
               B="230" />
        <SolidColorBrush x:Key="CharactersBlueBrush"
                         Color="{StaticResource CharactersBlue}" />

        <Style TargetType="{x:Type Button}">
            <Setter Property="MinHeight"
                    Value="23" />
            <Setter Property="MinWidth"
                    Value="75" />
        </Style>

        <Style x:Key="ImageToggleButton"
               TargetType="{x:Type ToggleButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <ContentPresenter x:Name="iButtonCC">
                            <ContentPresenter.Effect>
                                <DropShadowEffect BlurRadius="7"
                                                  ShadowDepth="0"
                                                  Color="White" />
                            </ContentPresenter.Effect>
                        </ContentPresenter>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver"
                                     Value="True">
                                <Setter TargetName="iButtonCC"
                                        Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="7"
                                                          ShadowDepth="0"
                                                          Color="Black" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed"
                                     Value="True">
                                <Setter TargetName="iButtonCC"
                                        Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="7"
                                                          ShadowDepth="0"
                                                          Color="Yellow" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsChecked"
                                     Value="True">
                                <Setter TargetName="iButtonCC"
                                        Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="7"
                                                          ShadowDepth="0"
                                                          Color="Lime" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ExWindowButtonStyle"
               TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Image x:Name="exMainImage"
                               Height="16"
                               Source="/Amuse;component/Images/ExWindow16Black.png">
                            <Image.Effect>
                                <DropShadowEffect BlurRadius="7"
                                                  ShadowDepth="0"
                                                  Color="White" />
                            </Image.Effect>
                        </Image>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver"
                                     Value="True">
                                <Setter Property="Source"
                                        TargetName="exMainImage"
                                        Value="/Amuse;component/Images/ExWindow16White.png" />
                                <Setter TargetName="exMainImage"
                                        Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="7"
                                                          ShadowDepth="0"
                                                          Color="Black" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed"
                                     Value="True">
                                <Setter TargetName="exMainImage"
                                        Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="7"
                                                          ShadowDepth="0"
                                                          Color="Yellow" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <SolidColorBrush x:Key="ProgressGreenBrush"
                         Color="#FF01D328" />

        <Style TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid Name="TemplateRoot"
                              SnapsToDevicePixels="True">
                            <Rectangle RadiusX="2"
                                       RadiusY="2"
                                       x:Name="bg"
                                       Fill="{TemplateBinding ProgressBar.Background}" />
                            <Border CornerRadius="2,2,2,2"
                                    Margin="1,1,1,1">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0"
                                                         EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#50FFFFFF"
                                                          Offset="0.5385" />
                                            <GradientStop Color="#00FFFFFF"
                                                          Offset="0.5385" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border BorderThickness="1,0,1,1"
                                    BorderBrush="#80FFFFFF"
                                    Margin="1,1,1,1">
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0"
                                                         EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#80FFFFFF"
                                                          Offset="0.05" />
                                            <GradientStop Color="#00FFFFFF"
                                                          Offset="0.25" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Rectangle Name="PART_Track"
                                       Margin="1,1,1,1" />
                            <Decorator Name="PART_Indicator"
                                       Margin="1,1,1,1"
                                       HorizontalAlignment="Left">
                                <Grid Name="Foreground">
                                    <Rectangle Fill="{TemplateBinding ProgressBar.Foreground}"
                                               Name="Indicator" />
                                    <Grid Name="Animation"
                                          ClipToBounds="True">
                                        <Rectangle Name="PART_GlowRect"
                                                   Width="100"
                                                   Margin="-100,0,0,0"
                                                   HorizontalAlignment="Left">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush StartPoint="0,0"
                                                                     EndPoint="1,0">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="0" />
                                                        <GradientStop Color="#60FFFFFF"
                                                                      Offset="0.4" />
                                                        <GradientStop Color="#60FFFFFF"
                                                                      Offset="0.6" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="1" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                    </Grid>
                                    <Grid Name="Overlay">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition MaxWidth="15" />
                                            <ColumnDefinition Width="0.1*" />
                                            <ColumnDefinition MaxWidth="15" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <Rectangle RadiusX="1"
                                                   RadiusY="1"
                                                   Name="LeftDark"
                                                   Margin="1,1,0,1"
                                                   Grid.RowSpan="2">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush StartPoint="0,0"
                                                                     EndPoint="1,0">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#0C000000"
                                                                      Offset="0" />
                                                        <GradientStop Color="#20000000"
                                                                      Offset="0.3" />
                                                        <GradientStop Color="#00000000"
                                                                      Offset="1" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle RadiusX="1"
                                                   RadiusY="1"
                                                   Name="RightDark"
                                                   Margin="0,1,1,1"
                                                   Grid.Column="2"
                                                   Grid.RowSpan="2">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush StartPoint="0,0"
                                                                     EndPoint="1,0">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#00000000"
                                                                      Offset="0" />
                                                        <GradientStop Color="#20000000"
                                                                      Offset="0.7" />
                                                        <GradientStop Color="#0C000000"
                                                                      Offset="1" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Name="LeftLight"
                                                   Grid.Column="0"
                                                   Grid.Row="2">
                                            <Rectangle.Fill>
                                                <RadialGradientBrush RadiusX="1"
                                                                     RadiusY="1"
                                                                     RelativeTransform="1,0,0,1,0.5,0.5">
                                                    <RadialGradientBrush.GradientStops>
                                                        <GradientStop Color="#60FFFFFF"
                                                                      Offset="0" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="1" />
                                                    </RadialGradientBrush.GradientStops>
                                                </RadialGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Name="CenterLight"
                                                   Grid.Column="1"
                                                   Grid.Row="2">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush StartPoint="0,1"
                                                                     EndPoint="0,0">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#60FFFFFF"
                                                                      Offset="0" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="1" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle Name="RightLight"
                                                   Grid.Column="2"
                                                   Grid.Row="2">
                                            <Rectangle.Fill>
                                                <RadialGradientBrush RadiusX="1"
                                                                     RadiusY="1"
                                                                     RelativeTransform="1,0,0,1,-0.5,0.5">
                                                    <RadialGradientBrush.GradientStops>
                                                        <GradientStop Color="#60FFFFFF"
                                                                      Offset="0" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="1" />
                                                    </RadialGradientBrush.GradientStops>
                                                </RadialGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Border Name="Highlight1"
                                                Grid.ColumnSpan="3"
                                                Grid.RowSpan="2">
                                            <Border.Background>
                                                <LinearGradientBrush StartPoint="0,0"
                                                                     EndPoint="0,1">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#90FFFFFF"
                                                                      Offset="0.5385" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="0.5385" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <Border Name="Highlight2"
                                                Grid.ColumnSpan="3"
                                                Grid.RowSpan="2">
                                            <Border.Background>
                                                <LinearGradientBrush StartPoint="0,0"
                                                                     EndPoint="0,1">
                                                    <LinearGradientBrush.GradientStops>
                                                        <GradientStop Color="#80FFFFFF"
                                                                      Offset="0.05" />
                                                        <GradientStop Color="#00FFFFFF"
                                                                      Offset="0.25" />
                                                    </LinearGradientBrush.GradientStops>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                    </Grid>
                                </Grid>
                            </Decorator>
                            <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
                                    CornerRadius="2,2,2,2"
                                    BorderBrush="{TemplateBinding Border.BorderBrush}" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="ProgressBar.Orientation">
                                <Setter Property="FrameworkElement.LayoutTransform"
                                        TargetName="TemplateRoot">
                                    <Setter.Value>
                                        <RotateTransform Angle="-90" />
                                    </Setter.Value>
                                </Setter>
                                <Trigger.Value>
                                    <x:Static Member="Orientation.Vertical" />
                                </Trigger.Value>
                            </Trigger>

                            <Trigger Property="ProgressBar.IsIndeterminate">
                                <Setter Property="UIElement.Visibility"
                                        TargetName="LeftDark">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="UIElement.Visibility"
                                        TargetName="RightDark">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="UIElement.Visibility"
                                        TargetName="LeftLight">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="UIElement.Visibility"
                                        TargetName="CenterLight">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="UIElement.Visibility"
                                        TargetName="RightLight">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="UIElement.Visibility"
                                        TargetName="Indicator">
                                    <Setter.Value>
                                        <x:Static Member="Visibility.Collapsed" />
                                    </Setter.Value>
                                </Setter>
                                <Trigger.Value>
                                    <s:Boolean>True</s:Boolean>
                                </Trigger.Value>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

        <DataTemplate x:Key="CommandHistoryItemDataTemplate">
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Stretch">
                <StackPanel.InputBindings>
                    <MouseBinding MouseAction="LeftDoubleClick"
                                  Command="{Binding RecallCommand}" />
                </StackPanel.InputBindings>
                <TextBlock Text="{Binding TimeRecorded}" />
                <TextBlock Text="-"
                           Margin="7,0" />
                <TextBlock Text="{Binding OriginalString}" />
            </StackPanel>
        </DataTemplate>
    </Application.Resources>
</Application>
